package org.flow.basic.doubts.tjbase;

import java.util.*;
import java.util.stream.Collectors;

/**
 * @author xl-9527
 * @since 2024/8/8
 */
public class SortTest {

    public static void main(String[] args) {
		m1();
		m2();
	}

	private static void m2() {

	}

	private static void m1() {
		Integer[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
		List<Integer> list = new ArrayList<>(Arrays.stream(arr).sorted().sorted(Comparator.comparing(Integer::intValue).reversed()).toList());

		list.removeIf(next -> next == 5);


		final Iterator<Integer> iterator = list.iterator();
		while (iterator.hasNext()) {
			final Integer next = iterator.next();
			if (next == 6) {
				iterator.remove();
			}
		}

		for (final Integer integer : list) {
			System.out.println(integer);
		}
		final String[] split = "".split("-", 1);
		System.out.println(split[0]);
	}
}
